package com.ruibang.glass.quality.controller;

import com.ruibang.glass.quality.domain.req.EverydayDiscardDefectReq;
import com.ruibang.glass.quality.service.EverydayDiscardDefectService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @Author: songJinKang
 * @CreateTime: 2023-08-30  10:54
 * @Description: TODO：每日判废缺陷数量及曲线
 * @Version: 1.0
 */

@RestController
@RequestMapping("/api/discard/defect/everyday")
@Api(value = "每日判废缺陷数量及曲线（冷端）", tags = {"每日判废缺陷数量及曲线（冷端）"})
public class EverydayDiscardDefectController {


    @Autowired
    private EverydayDiscardDefectService everydayDiscardDefectService;


    @PostMapping("/queryEverydayDiscardDefect")
    @ApiOperation(value = "查询每日判废缺陷数量及曲线", notes = "查询每日判废缺陷数量及曲线")
    public ResultBody queryEveryHourColdDirect(@RequestBody @Valid EverydayDiscardDefectReq everydayDiscardDefectReq) {
        return everydayDiscardDefectService.queryEverydayDiscardDefect(everydayDiscardDefectReq);
    }

    @PostMapping("/queryPageEveryHourColdDirect")
    @ApiOperation(value = "查询每日判废缺陷数据(分页)", notes = "查询每日判废缺陷数据(分页)")
    public ResultBody queryPageEveryHourColdDirect(@RequestBody @Valid EverydayDiscardDefectReq everydayDiscardDefectReq) {
        return everydayDiscardDefectService.queryPageEveryHourColdDirect(everydayDiscardDefectReq);
    }
}
